<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        class Person{
            constructor(name,age){
                this.name = name;
                this.age = age;
                this.jump = function(){
                    console.log("class类的写法");
                }
            }
            //添加到原型对象上
            hobby(){
                console.log("吃肉");
            }
            //所有实例对象上添加
            sex = "男";
            //Person上添加  静态属性和方法
            static color = "pink";
        }
        let p1 = new Person("tom",18);
        console.log(p1);
    </script>
</body>
</html>